//
//  JAChannelLable.m
//  网易新闻
//
//  Created by Arvin on 17/3/18.
//  Copyright © 2017年 Arvin. All rights reserved.
//

#import "JAChannelLable.h"

const CGFloat bigFontSize = 20;
const CGFloat smallFontSize = 16;

@implementation JAChannelLable

+(JAChannelLable *)lableWithModel:(JAChannelModel *)model{
    
    JAChannelLable *lable = [[JAChannelLable alloc]init];
    
    lable.text = model.tname;
    //文字居中
    lable.textAlignment = NSTextAlignmentCenter;
    lable.font = [UIFont systemFontOfSize:bigFontSize];
    lable.textColor = [UIColor redColor];
    [lable sizeToFit];
    
    return lable;
}

-(void)setIsSelected:(BOOL)isSelected{
    
    _isSelected = isSelected;
    
    //当不被选中时,显示小字黑色
    if(_isSelected == NO)
    {
        self.font = [UIFont systemFontOfSize:smallFontSize];
        self.textColor = [UIColor blackColor];
    }
    //如果选中则显示红色大字
    else{
        self.font = [UIFont systemFontOfSize:bigFontSize];
        self.textColor = [UIColor redColor];
    }
}

@end
